<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>03-块级作用域</title>
</head>
<body>
    <script>
        // 我们js也是在es6的时候新增的块级作用域
        // 块级作用域 {}  if {}    for{}

        // 外面是不能调用num的
        if(true){
            let num = 10;
            var age = 22;
        }
        console.log(age);   //22
        console.log(num);  //num is not defined  注意声明变量 let var
    </script>
</body>
</html>